package com.william.taskrobot.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.william.taskrobot.mapper.DictMapper;
import com.william.taskrobot.model.entity.Dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * DBService class
 * 数据库操作
 * @author william
 * @date 2021/1/15
 */
@Service
public class DBService {
    @Autowired
    private DictMapper dictMapper;
    public Dict existDic(String word){
        QueryWrapper<Dict> queryWrapper=new QueryWrapper<Dict>();
        queryWrapper.eq("word",word);
        Dict dict=dictMapper.selectOne(queryWrapper);
        return dict;
    }
}
